vnet: Another build fix for finding Linux build tree and version.
authorKeir Fraser <keir@xensource.com>
Sat, 28 Apr 2007 08:44:24 +0000 (09:44 +0100)
committerKeir Fraser <keir@xensource.com>
Sat, 28 Apr 2007 08:44:24 +0000 (09:44 +0100)
Signed-off-by: Robert Valentan <R.Valentan@solid-soft.at>
tools/vnet/vnet-module/00README
tools/vnet/vnet-module/Makefile.ver

index 651164ca9f8963cb28a07b3b1335c104be299d08..707b965f085469892552b710a6461a3167e6e021 100644 (file)
@@ -9,8 +9,8 @@ can be set in your env or on the make command line:
 LINUX_SERIES:   linux release to compile for: 2.4, or 2.6 (default).
 XEN_ROOT:       root of the xen tree containing kernel source.
 KERNEL_VERSION: kernel version, default got from XEN_ROOT.
-KERNEL_MINOR:   kernel minor version, default -xen0.
-KERNEL_SRC:     path to kernel source, default linux-<VERSION> under XEN_ROOT.
+KERNEL_SRC:     path to kernel source, default build-linux-<VERSION> 
+                under XEN_ROOT.
 
 *) For 2.4 kernel
 
index 76382c2a320531505c1a64db9a3fdfe8e95aa08f..dcd6e0f736544868cb909ea987650d9f733ea156 100644 (file)
 # 59 Temple Place, suite 330, Boston, MA 02111-1307 USA
 #============================================================================
 
-include $(XEN_ROOT)/Config.mk
-
 LINUX_SERIES?=2.6
-ifeq ($(XEN_SPLIT_KERNEL),y)
-  KERNEL_MINOR=-xen0
-else
-  KERNEL_MINOR=-xen
-endif
 
 LINUX_VERSION?=$(shell (/bin/ls -d $(XEN_ROOT)/pristine-linux-$(LINUX_SERIES).* 2>/dev/null) | \
                       sed -e 's!^.*linux-\(.\+\)!\1!' )
@@ -34,16 +27,19 @@ ifeq ($(LINUX_VERSION),)
 $(error Kernel source for linux $(LINUX_SERIES) not found)
 endif
 
-KERNEL_VERSION=$(LINUX_VERSION)$(KERNEL_MINOR)
+KERNEL_VERSION?=$(shell (/bin/ls -d $(XEN_ROOT)/build-linux-$(LINUX_VERSION)-xen* 2>/dev/null) | \
+                      grep -v -m 1 -e '-xenU' | \
+                      sed -e 's!^.*linux-\(.\+\)!\1!' )
 
-KERNEL_SRC ?= $(shell cd $(XEN_ROOT)/build-linux-$(KERNEL_VERSION)_$(XEN_TARGET_ARCH) && pwd)
+KERNEL_SRC ?= $(XEN_ROOT)/build-linux-$(KERNEL_VERSION)
 
 ifeq ($(KERNEL_SRC),)
 $(error Kernel source for kernel $(KERNEL_VERSION) not found)
 endif
 
 # Get the full kernel release version from its makefile, as the source path
-# may not have the extraversion, e.g. linux-2.6.12-xen0 may contain release 2.6.12.6-xen0.
+# may not have the extraversion, e.g. linux-2.6.12-xen0 may contain release 
+# 2.6.12.6-xen0.
 KERNEL_RELEASE=$(shell make -s -C $(KERNEL_SRC) kernelrelease)
 
 KERNEL_MODULE_DIR=/lib/modules/$(KERNEL_RELEASE)/kernel